package com.nancy.java_design.proxy.demo3;


/**
 * JDK动态代理
 */
public class Client {
    public static void main(String[] args) {
        // 创建代理工厂对象
        CGLIBProxyFactory proxyFactory = new CGLIBProxyFactory();
        // 获取代理对象
        TranStation tranStation = (TranStation) proxyFactory.getProxyInstance();
        // 调用代理对象的方法
        tranStation.sellTicket();
        tranStation.returnTickets();
    }
}
